<style type="text/css">
    body {
        background:#eee;
    }
    div.head {
        background:#eee;
        border-bottom:1px solid #ccc;
    }
    div.head h2 {
        height:80px;
        line-height:80px;
        text-indent:5em;
    }
    div.login-form {
        width:800px;
        height:400px;
        background:#fff;
        border:1px solid #ccc;
        margin:60px auto;
    }
    div.login-form h3 {
        border-bottom:1px solid #ccc;
        height:50px;
        line-height:50px;
        font-size:20px;
        text-indent:16em;
    }
    div.login-form form {
        margin:80px 0 0 150px;
    }
    div.login-form form label{
        font-size:15px;
        margin-top:5px;
        font-weight:bold;
    }
    div.login-form form input {
        height:25px;
    }
    div.login-form form input.checkcode {
        width:90px;
    }
    div.login-form form input.sub {
        width:340px;
        height:35px;
        position:relative;
        right:110px;
        font-size:15px;
    }
    div.login-form form span.img {
        float:right;
        margin:0 280px 0 0;
    }
    .help-inline {
        color:red;
    }
</style>
<script type="text/javascript">
    // 这个方法是解决页面刷新 验证码不变的最好办法，也能兼容ajax
    $(document).ready(function(){
        var img = new Image;
        img.onload=function(){
            $('#yw0').trigger('click');
        };
        img.src = $('#yw0').attr('src');
    });
</script>
<div class="head">
    <h2>博客后台登陆中心</h2>
</div>
<div class="login-form">
    <h3>管理员登录</h3>
    <?php $form=$this->beginWidget('BActiveForm', array(
        'id'=>'login-form',
        'enableClientValidation'=>true,
        'enableAjaxValidation'=>false,
        'clientOptions'=>array(
            'validateOnSubmit'=>false,
        ),
    )); ?>
    <div class="control-group">
        <label class="control-label">管理员名称：</label>
        <div class="controls">
            <?php echo $form->textField($model,'adminName'); ?>
            <?php echo $form->error($model,'adminName'); ?>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">管理员密码：</label>
        <div class="controls">
            <?php echo $form->passwordField($model,'adminPass'); ?>
            <?php echo $form->error($model,'adminPass'); ?>
        </div>
    </div>
    <?php if(CCaptcha::checkRequirements()): ?>
    <div class="control-group">
        <label class="control-label">验证码：</label>
        <div class="controls">
            <span class="img"><?php $this->widget('CCaptcha', array('clickableImage'=>true, 'showRefreshButton'=>false)); ?></span>
            <?php echo $form->textField($model,'checkCode', array('class'=>'checkcode')); ?>
            <?php echo $form->error($model,'checkCode'); ?>
        </div>
    </div>
    <div class="control-group">
        <div class="controls">
            <input type="submit" value="登录" id="submit" class="sub btn btn-primary"/>
        </div>
    </div>
    <?php $this->endWidget();?>
    <?php endif;?>
</div>